import React from 'react';
import { View } from 'react-native';

function Authorized(props) {
  const { children, authority, noMatch = null } = props;
  if (authority) {
    return children;
  }
  return <View>{noMatch && noMatch()}</View>;
}

export default Authorized;
